package gsw.demo.mvp.core.net.config;

import android.content.Context;

/**
 * 初始化Config
 */
public class ConfigInit {
    public static Config init(Context context) {
        Config.getInstance().getConfigs().put(ConfigKeys.CONTEXT.name(), context.getApplicationContext());
        return Config.getInstance();
    }

    public static Config getConfigurator() {
        return Config.getInstance();
    }

    public static <T> T getConfiguration(Object key) {
        return getConfigurator().getConfiguration(key);
    }

    public static Context getApplicationContext() {
        return getConfiguration(ConfigKeys.CONTEXT.name());
    }

}
